@extends('layouts.header')
@section('content')
    <nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 检测业务 <span class="c-gray en">&gt;</span> 结果录入
        <a class="btn btn-primary radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <div class="page-container">
        <table class="table table-border table-bordered table-hover table-bg table-responsive" id="datatable">
            <thead>
            {{-- <tr>
                <th scope="col" colspan="6">合同管理</th>
            </tr> --}}
            <tr class="text-c">
                <th>批次编号</th>
                <th>客户名称</th>
                <th>受理人</th>
                <th>受理时间</th>
                <th>完成期限</th>
                <th>批次状态</th>
                {{-- <th>任务总量</th> --}}
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach ($data as $val)
                <tr class="text-c">
                    <td>{{ $val->batchNum }}</td>
                    <td>{{ $val->client_name }}</td>
                    <td>{{ $val->creator }}</td>
                    <td>{{ $val->created_at }}</td>
                    <td>{{ $val->deadline ? $val->deadline : '/' }}</td>
                    <td>
                        @if ($val->status==5)
                            <span class="badge badge-primary radius">试验中</span>
                        @elseif ($val->status==8)
                            <span class="badge badge-warning radius">审核中</span>
                        @elseif ($val->status==11)
                            <span class="badge badge-default radius">已审核@if($val->back_count > 0) <span class="c-red">({{$val->back_count}})</span>@endif</span>
                        @elseif ($val->status==13)
                            <span class="badge badge-danger radius">批准驳回</span>
                        @elseif ($val->status==14)
                            <span class="badge badge-success radius">批准通过</span>
                        @elseif ($val->status==17)
                            <span class="badge badge-success radius">待退样</span>
                        @else
                            <span class="badge badge-danger radius">未知</span>
                        @endif
                    </td>
                    {{-- <td>{{ $val->sum_count }}</td> --}}
                    <td class="text-l">
                        <a class="ml-5 btn btn-primary-outline radius size-MINI" href="javascript:;" onclick="jump_page('/{{config('constant.name_admin')}}/sampleInfo/indexResLuru',{{ $val->id }})">点击进入</a>
                        @if ($val->status==13)
                            <a class="ml-5 btn btn-danger-outline radius size-MINI" href="javascript:;" onclick="show_baklog({{ $val->id }})">驳回原因</a>
                        @endif
                    </td>
                </tr>
            @endforeach

            </tbody>
        </table>
    </div>

    <!--请在下方写此页面业务相关的脚本-->
    <script type="text/javascript">
        $(function () {
            $('#datatable').DataTable({
                order:[[0,'desc']],
                "lengthMenu": [15,25,50,100], // 设置每页显示条数的选项
                pageLength:15
            })
        })
        /* 跳转页面 */
        function jump_page(url, id) {
            location.href = url + '?id=' + id;
        }

        /* function myrefresh()
        {
            window.location.reload();
        }
        setTimeout('myrefresh()',1000); //指定1秒刷新一次 */

        /*查看驳回原因*/
        function show_baklog(id) {
            let url = '/{{config('constant.name_admin')}}/sampleinfo/rejectLog/1/' + id;
            layer_show('驳回原因', url, 500, 400);
        }

    </script>
@endsection